package com.hbnu.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hbnu.system.model.entity.Dept;
import org.apache.ibatis.annotations.Select;


public interface DeptMapper extends BaseMapper<Dept> {
    /**
     * 根据院系id获取院系名称
     * @param deptid
     * @return
     */
    @Select("SELECT deptName FROM dept WHERE DeptID = #{deptid}")
    String getDeptNameByDeptID(String deptid);

    /**
     * 根据院系名称获取院系ID
     * @param deptName
     * @return
     */
    @Select("SELECT DeptID FROM dept WHERE deptName = #{deptName}")
    String getDeptIdByDeptName(String deptName);

    /**
     * 获取最大院系id
     * @return
     */
    @Select("SELECT MAX(deptName_id) FROM dept")
    Integer selectMaxDeptNameId();
}
